<<<<<<< HEAD
<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:67:"C:\wamp200\www\xgwnew/application/index\view\address\addwxopen.html";i:1544276805;}*/ ?>
=======
<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:67:"C:\wamp200\www\xgwnew/application/index\view\address\addwxopen.html";i:1538361716;}*/ ?>
>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e
<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

    <title>腾讯地图</title>
    <link rel="stylesheet" href="__PUBLIC__/xsd/css/mui.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/icons-extra.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/app.css?v1111121" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/checkout.css" />
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/xsd/js/mui.min.js"></script>
<script src="__PUBLIC__/xsd/js/flexible.js"></script>
<script src="__PUBLIC__/xsd/js/template.js"></script>
  <body>
  	
<style>
.mui-btn-block{
  padding: 5px;
  border: 1px solid #ccc !important;
  margin: 5px;
  -webkit-appearance: none;
}

.fill-section {
    padding-left: 15px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.fill-section li {
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.fill-section li:last-child {
    border-bottom: none;
}
.fill-type {
    float: left;
    line-height: 44px;
}

.customer-section .fill-type {
    width: 50px;
}

.customer-section .fill-section-right {
    margin-left: 50px;
}

.fill-phone-right {
    position: relative;
}

.fill-input {
    width: 100%;
    height: 44px !important;
    line-height: 38px !important;
    border: 0 !important;
    font-size: 14px;
    padding: 0 !important;
}

.customer-gender {
    border-top: 1px solid #f0f0f0;
    height: 44px;
}

.customer-gender-choice {
    float: left;
    width: 50%;
    height: 44px;
    line-height: 44px;
    padding-left: 10px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.customer-gender-choice .i-circle {
    float: left;
    width: 16px;
    height: 16px;
    line-height: 16px;
    border: 1px solid #999;
    margin: 12px 8px 0 0;
}

.customer-gender-check .i-circle {
    width: 18px;
    height: 18px;
    line-height: 18px;
    border: 0;
    background-color: #ffd300;
    text-align: center;
    color: #6b450a;
    font-size: 14px;
    font-family: 'iconfonts';
}

.customer-gender-check .i-circle:before {
    content: '\e61a';
}

.address-section .fill-section-right {
    display: block;
    height: 44px;
    margin-left: 105px;
}

.addr-icon {
    float: left;
    margin-top: 10px;
    color: #888;
}

.addr-choose {
    display: block;
    padding: 0 !important;
    line-height: 44px !important;
    height: 44px !important;
    font-size: 13px;
    color: #333;
    border: 0 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: auto !important;

}

.addr-arrow {
    float: right;
    margin: 16px 12px 0 0;
    width: 10px;
    height: 10px;
    border: 1px solid #ddd;
    border-width: 1px 1px 0 0;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    transform: rotate(45deg);
}

.addr-save-btn {
    width: 93%;
    height: 44px;
    margin: 15px auto;
    background-color: #fff;
    color: #fa9700;
    font-size: 16px;
    line-height: 44px;
    text-align: center;
}

.addr-tip-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 44px;
    z-index: 10;
    display: none;
    background-color: #f8f8f8;
    border: 1px solid #eaeaea;
}

.addr-tip-list li {
    height: 40px;
    padding: 3px 0 3px 3px;
    border-bottom: 1px solid #eaeaea;
}

.addr-tip-list li p {
    height: 40px;
    line-height: 40px;
    padding-left: 13px;
    color: #2f2f2f;
}

.addr-tip-list li.tip-selected p {
    height: 40px;
    background-color: #eaeaea;
}

.addr-tip-list li.tip-hide {
    display: none;
}
ul, ol {
    padding-left: 0;
    list-style-type: none;
}
<<<<<<< HEAD

.form-buttonhx-wrap {
    padding: .1rem .4rem;
    display: -webkit-box;
    display: -ms-flexbox;
    width:50%;
    display: flex
}
</style>
<div id="content">
 <!-- <header class="mui-bar mui-bar-nav" style="z-index:7">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>   
</header> -->
<div class="mui-content ">
  <!-- <h5 style="margin:10px 5px;">联系人</h5> -->
  <a href="javascript:getaddr();">
=======
</style>
<div id="content"  style="display:none;">
<header class="mui-bar mui-bar-nav" style="z-index:7">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>   
</header>
<div class="mui-content ">
  <!-- <h5 style="margin:10px 5px;">联系人</h5> -->
>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e
  <div class="formbloack username" >
      <div class="label-wrap" >姓名</div>
      <div class="input-group-wrap" >
          <div class="input-wrap" > <input type="text" readonly="readonly" style="margin-bottom: 0;    padding-left: 0;" placeholder="收货人姓名" name="name" value="<?php echo $info['name']; ?>" > </div>
          <div class="input-wrap bottom" > <span class="form-radio" > <span class="radio-icon  <?php if($info['sex'] != '2'): ?>checked<?php endif; ?>" data-sex="1" ></span> 先生 </span> <span class="form-radio" > <span class="radio-icon <?php if($info['sex'] == '2'): ?>checked<?php endif; ?>" data-sex="2" ></span> 女士 </span>
          </div>
      </div>
  </div>

  <div class="formbloack phone" >
      <div class="label-wrap" >手机</div>
      <div class="input-group-wrap rightbtn">
          <div class="input-wrap" style="    padding: .173333rem 0;"> <input placeholder="收货人的手机号"  readonly="readonly" type="tel" name="tel" value="<?php echo $info['tel']; ?>" style="margin-bottom: 0;    padding-left: 0;"> </div>
      </div>
  </div>
  <!-- <h5 style="margin:10px 5px;">收货地址</h5> -->

  <ul class="fill-section address-section">
    <?php if(\think\Cookie::get('address_type') == '1'): ?>
      <li>
          <span class="fill-type">详细地址：</span>
          <div class="fill-section-right">
              <input type="text" class="fill-input j-house-number" name="address" placeholder="" value="<?php echo $info['address']; ?>" />
              <input type="hidden"  name="type" value='1' />
          </div>
      </li>
    <?php else: ?>
    <li>
        <span class="fill-type">区域：</span>
<<<<<<< HEAD
        <!-- <a class="fill-section-right showmap" href="javascript:;">-->
        	
            <i class="icon-loc-hollow addr-icon mui-icon mui-icon-location"></i>
            <!-- <i class="addr-arrow"></i>-->
            <!-- <input type="text"  readonly="readonly" class="addr-choose j-address" name="address" readonly placeholder="点击选择(请耐心等待)" value="<?php echo !empty($info['latlng'])?$info['address'] : ''; ?>" />-->
           <input type="text"  readonly="readonly" class="addr-choose j-address" name="address" readonly  value='<?php echo $info['address']; ?> ' />
            <!--  <input type="hidden" class="addr-choose j-address" name="address_full" value="<?php echo !empty($info['latlng'])?$info['address_full'] : ''; ?>" /> -->
           <!--  <input type="hidden" class="addr-choose j-address" name="latlng" value='<?php echo $info['latlng']; ?> ' />-->
             <!--  <input type="hidden"  name="type" value='0' />-->
              

       
=======
        <a class="fill-section-right showmap" href="javascript:;">
            <i class="icon-loc-hollow addr-icon mui-icon mui-icon-location"></i>
            <i class="addr-arrow"></i>
            <input type="text"  readonly="readonly" class="addr-choose j-address" name="address" readonly placeholder="点击选择(请耐心等待)" value="<?php echo !empty($info['latlng'])?$info['address'] : ''; ?>" />
            <!-- <input type="hidden" class="addr-choose j-address" name="address_full" value="<?php echo !empty($info['latlng'])?$info['address_full'] : ''; ?>" /> -->
            <input type="hidden" class="addr-choose j-address" name="latlng" value='<?php echo $info['latlng']; ?> ' />
              <input type="hidden"  name="type" value='0' />
        </a>
>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e
    </li>
    <li>
        <span class="fill-type">位置：</span>
        <div class="fill-section-right">
<<<<<<< HEAD
            <input type="text"  readonly="readonly" class="fill-input j-house-number" name="address_full" placeholder="区域" value="<?php echo $info['address_full']; ?>" />
            
        </div>
    </li>
     </a>
=======
            <input type="text"  readonly="readonly" class="fill-input j-house-number" name="address_full" placeholder="区域" value="<?php echo $info['house_number']; ?>" />
        </div>
    </li>
>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e
    <li>
        <span class="fill-type">楼号－门牌号：</span>
        <div class="fill-section-right">
            <input type="text"  class="fill-input j-house-number" name="house_number" placeholder="例16号楼427室" value="<?php echo $info['house_number']; ?>" />
        </div>
    </li>
<<<<<<< HEAD
     <li>
        <span class="fill-type">微信号(可选)：</span>
        <div class="fill-section-right">
            <input type="text"  class="fill-input j-house-number" name="wx_number" placeholder="便于微信联系您" value="<?php echo $info['wx_number']; ?>" />
        </div>
    </li>
=======
>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e
    
    
    <?php endif; ?>
  </ul>
  <input type="hidden" value="<?php echo $info['id']; ?>" name="id" />
  <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript">
wx.config(<?php echo json_encode($wxoptions); ?>);
 wx.ready(function () { 
  });  
 function getaddr() { wx.openAddress({ success: function (res) { 
 // 用户成功拉出地址
// '[name="tel"]'.val()=res.telNumber
$('[name="tel"]').val(res.telNumber)
$('[name="name"]').val(res.userName)
$('[name="address"]').val(res.provinceName+" "+res.cityName+" "+res.countryName)
$('[name="address_full"]').val(res.detailInfo)
$('#content').show()
//$('[name="tel"]').val(res.telNumber)
}, 

 cancel: function (errMsg) {
  // 用户取消拉出地址 //
<<<<<<< HEAD
  //alert(JSON.stringify(errMsg)); 
  }});
}
=======
  alert(JSON.stringify(errMsg)); }}); }
>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e




     </script>


<<<<<<< HEAD
  
  	
  	 <span class="form-button-wrap"><button class="form-button" type="button" id="addAddress" ><strong>提 交</strong></button></span>
  	
  	 <span class="form-button-wrap"><a class="form-button" type="button" href="javascript:getaddr();"><strong>获得收货地址</strong></a></span></div>


</div>



  

=======
  <div class="form-button-wrap" > <button class="form-button" type="button" id="addAddress" >提 交</button> </div>

</div>
</div>


<div id="map" >
  <div class="form-button-wrap" ><a class="form-button" type="button" href="javascript:getaddr();"><strong>一键获得收货地址</strong></a> </div>
</div>
>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e


<script type="text/javascript">


  $(function(){
    $('[name="first_area"]').change(function(){
      var $this = $(this),id = $this.val();
      $('[name="second_area"]').html(' ');
      $.post("<?php echo url('index/index/getSecondArea'); ?>", {
          "id": id
      }, function(data) {

        var html = template('tpl', data);
        $('[name="second_area"]').html(html);

      }, "json");
    })
    $('[name="first_area"]').change();

    $('.form-radio').click(function(){
      $(this).find('.radio-icon').addClass('checked')
      $(this).siblings().find('.radio-icon').removeClass('checked')
    })


    $('#addAddress').click(function(){
          var name = $.trim($('[name="name"]').val()),
              sex = $(".form-radio").find('.checked').attr('data-sex'),
              tel = $.trim($('[name="tel"]').val()),
              id = $('[name="id"]').val(),
              address= $.trim($('[name="address"]').val()),
              address_full= $.trim($('[name="address_full"]').val()),
              latlng= $.trim($('[name="latlng"]').val()),
              house_number= $.trim($('[name="house_number"]').val()),
<<<<<<< HEAD
              wx_number= $.trim($('[name="wx_number"]').val()),
=======
>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e
              type =  $.trim($('[name="type"]').val())
         if(!name){
           mui.toast('请输入收货人姓名')
           return;
         }
         if (!tel) {
              mui.toast("请输入号码！");
              return;
          }
         if (!address) {
              mui.toast("请选择地址！");
              return;
          }
         if ($('[name="house_number"]').length > 0 && !house_number) {
              mui.toast("请填写楼号－门牌号！");
              return;
          }
<<<<<<< HEAD
   
=======

>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e
         $.post("<?php echo url('index/address/addwxopen'); ?>", {
           "id": id,
           "name": name,
           "sex": sex,
           "tel": tel,
           "address": address,
           "address_full": address_full,
           "latlng": latlng,
           "house_number": house_number,
<<<<<<< HEAD
           "wx_number": wx_number,
=======
>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e
           "type": type
         }, function(data) {
             if(data.code == 1){
               setTimeout(function() {
                 //mui.back();
                 //self.location=document.referrer;
                 window.location.href= data.url
               }, 1000);
             }
             mui.toast(data.msg)
         }, "json");
    })

    //地址类型
    $('[name="type"]').click(function(){
      var val = $(this).val();
      if(val != 1){
        $('#sqdz').show()
      }else{
        $('#sqdz').hide()
      }
    })
  })
</script>



</body>
</html> 